#include <bits/stdc++.h>

#include <atcoder/all>
#define LL long long
using namespace std;
using namespace atcoder;

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int T;
  for (T = 1; T; T--) {
    int n;

    cin >> n;
    map<int, int> pos2id;
    vector<int> X(n), R(n);

    for (int i = 0; i < n; i++) {
      cin >> X[i] >> R[i];
      pos2id[X[i] + R[i]] = 0;
      pos2id[X[i] - R[i]] = 0;
    }

    vector<int> deg(pos2id.size(), 0);
    dsu DSU(deg.size());

    int tot = 0;
    for (auto& it : pos2id) {
      it.second = tot++;
    }
    for (int i = 0; i < n; i++) {
      int u = pos2id[X[i] + R[i]], v = pos2id[X[i] - R[i]];

      DSU.merge(u, v);
      deg[u]++;
      deg[v]++;
    }

    int ans = 0;
    for (auto g : DSU.groups()) {
      int sumd = 0;
      for (int x : g) {
        sumd += deg[x];
      }
      sumd /= 2;
      if (sumd >= g.size()) {
        ans += g.size();
      } else {
        ans += sumd;
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
